
const logSymbols = require('log-symbols');
const chalk = require('chalk');
const tool = require('./tools/utils.js');

export default async function (...args) {

    // 获取仓库列表
    const res = await tool.request({
        url: 'git 仓库地址',
        method: 'GET'
    });
    let list;
    if (res.status === 200) {
        console.log(logSymbols.info, chalk.green('模板列表如下：'));
        list = res.data.filter((item) => {
            return item.name.includes('ly-cli') && item.name.includes('template');
        }).forEach(item => {
            console.log();
            console.log(chalk.green(item.name));
        });
    } else {
        console.log(logSymbols.error, `获取仓库列表失败 ${res.data}`);
    }
}